package com.exchange.dto;

import com.exchange.entity.GiftCardProduct;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class GiftCardProductDto {
    private Long id;
    private Long giftCardId;
    private Long productId;
    private Integer quantity;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    
    public static GiftCardProductDto fromEntity(GiftCardProduct giftCardProduct) {
        GiftCardProductDto dto = new GiftCardProductDto();
        dto.setId(giftCardProduct.getId());
        dto.setGiftCardId(giftCardProduct.getGiftCardId());
        dto.setProductId(giftCardProduct.getProductId());
        dto.setQuantity(giftCardProduct.getQuantity());
        dto.setCreatedAt(giftCardProduct.getCreatedAt());
        dto.setUpdatedAt(giftCardProduct.getUpdatedAt());
        return dto;
    }
}